<script setup>
import { onMounted, reactive, ref } from 'vue'
import Card from '@/views/new-screen/components/card.vue'
import DrawEcharts from '@/components/draw-echarts.vue'
import { Search } from '@element-plus/icons-vue'
import today from '../../../../assets/imgs/br_sel.png'
import month from '../../../../assets/imgs/by_nor.png'
import total from '../../../../assets/imgs/lj_nor.png'
import {
  getScreenAlterDetail,
  getScreenAlterTotal,
  getWarnIncident,
} from '@/api/screen/home/index'
import { useDict } from '@/hooks/useDict'
import { ElMessage } from 'element-plus'

const { dict } = useDict(['warning_type'])

const props = defineProps({
  isExpanded: Boolean,
  activePark: String,
})

const event = ref('')

const eventTable = ref([
  {
    name: '摄像头1',
    type: '抽烟',
    time: '08-19 12:12:12',
    online: 1,
  },
  {
    name: '摄像头1',
    type: '抽烟',
    time: '08-19 12:12:12',
    online: 0,
  },
  {
    name: '摄像头1',
    type: '抽烟',
    time: '08-19 12:12:12',
    online: 1,
  },
  {
    name: '摄像头1',
    type: '抽烟',
    time: '08-19 12:12:12',
    online: 0,
  },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 1,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 1,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 1,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 1,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
  // {
  //   name: '摄像头1',
  //   type: '抽烟',
  //   time: '08-19 12:12:12',
  //   online: 0,
  // },
])

const eventTaskOptions = [
  {
    name: '已完成', //名称
    value: 100, //值
    percent: 58,
    itemStyle: {
      //颜色
      color: '#50FEA3',
    },
  },
  {
    name: '未完成',
    value: 80,
    percent: 30,
    itemStyle: {
      color: '#36D5F0',
    },
  },
  {
    name: '已超时',
    value: 60,
    percent: 12,
    itemStyle: {
      color: '#FAB54F',
    },
  },
]

const eventNumList = ref([
  {
    img: today,
    name: '本日',
    value: 9,
    key: 'todaytotal',
  },
  {
    img: month,
    name: '本月',
    value: 9,
    key: 'monthtotal',
  },
  {
    img: total,
    name: '累计',
    value: 9,
    key: 'total',
  },
])

const getEventInfoListData = () => {
  getScreenAlterTotal({}).then((res) => {
    if (res.success) {
      eventNumList.value =
        eventNumList.value?.map((item) => {
          return {
            ...item,
            value: res.data[item.key],
          }
        }) || []
    } else {
      ElMessage.error(res.message)
    }
  })
}

let event3DOptions = ref('')

let diff = [
  { name: '外来人员', value: 10, unit: '' },
  { name: '人员闯入', value: 90, unit: '' },
  { name: '抽烟', value: 80, unit: '' },
  { name: '攀爬', value: 70, unit: '' },
  { name: '烟雾及烟火', value: 60, unit: '' },
  { name: '安全通道占用', value: 78, unit: '' },
  { name: '外来车辆', value: 78, unit: '' },
]

const classificationOptions = {
  backgroundColor: 'transparent',
  tooltip: {
    show: true,
    trigger: 'item',
    padding: [8, 15],
    backgroundColor: 'rgba(12, 51, 115,0.8)',
    borderColor: 'rgba(3, 11, 44, 0.5)',
    textStyle: {
      color: 'rgba(255, 255, 255, 1)',
    },
  },
  legend: { show: false },
  grid: { left: '22%', right: '12%', top: '5%', bottom: '3%' },
  xAxis: [
    {
      splitLine: { show: false },
      type: 'value',
      show: false,
      axisLine: {
        //x轴坐标轴，false为隐藏，true为显示
        show: false,
      },
    },
  ],
  yAxis: [
    {
      show: true,
      splitLine: { show: false },
      axisLine: { show: false },
      type: 'category',
      axisTick: { show: false },
      inverse: true,
      axisLabel: { show: false },
    },
    {
      type: 'category',
      inverse: true,
      axisTick: 'none',
      axisLine: 'none',
      show: true,
      axisLabel: {
        color: '#fff',
        fontSize: 12,
        formatter: function (value, index) {
          return value + diff[index].unit
        },
      },
      data: diff,
    },
  ],
  series: [
    {
      show: true,
      name: '',
      type: 'bar',
      data: diff,
      barWidth: 5, // 柱子宽度
      showBackground: true,
      label: {
        show: true,
        width: 200,
        offset: [0, 0],
        color: '#C4EAFF',
        fontSize: 12,
        fontWeight: 500,
        position: 'left',
        formatter: function (params) {
          return params.data.name
        },
      },
      itemStyle: {
        show: true,
        borderRadius: [10, 10, 10, 10],
        color: {
          type: 'linear',
          colorStops: [
            { offset: 1, color: 'rgba(255,210,143, 1)' },
            { offset: 0, color: 'rgba(255,210,143, 0)' },
          ],
        },
      },
      emphasis: { disabled: true },
    },
    {
      name: '',
      type: 'scatter',
      emphasis: { scale: false },
      symbol: 'rect',
      symbolSize: [0, 0], // 进度条白点
      itemStyle: {
        show: true,
        color: '#FFF',
        // shadowColor: 'rgba(255, 255, 255, 0.5)',
        shadowBlur: 5,
        borderWidth: 1,
        opacity: 1,
      },
      z: 2,
      data: diff,
      animationDelay: 500,
    },
  ],
}

const classificationChartRef = ref()

const getWaringTypeData = () => {
  getScreenAlterDetail({
    type: 'today',
  }).then((res) => {
    if (res.success) {
      // console.log(res.data)
      const data = res.data?.map((item) => {
        return {
          name: item.content,
          value: item.messagecount || 0,
          unit: '',
        }
      })
      classificationOptions.yAxis[1].data = data
      classificationOptions.yAxis[1].axisLabel.formatter = function (
        value,
        index,
      ) {
        return value + data[index].unit
      }
      classificationOptions.series[0].data = data
      classificationOptions.series[1].data = data
      classificationChartRef.value?.updateOption(classificationOptions)
    } else {
      ElMessage.error(res.message)
    }
  })
}

const paginationParams = reactive({
  content: '',
  parkId: props.activePark,
  pageIndex: 1,
  pageSize: 5,
})

const totalNums = ref(0)

const handleChange = (val) => {
  paginationParams.pageIndex = val
  getWarnList()
}

const getPie3D = (pieData, internalDiameterRatio) => {
  let series = []
  let sumValue = 0
  let startValue = 0
  let endValue = 0
  let legendData = []
  let legendBfb = []
  let k = 1 - internalDiameterRatio
  pieData.sort((a, b) => {
    return b.value - a.value
  })
  // 为每一个饼图数据，生成一个 series-surface(参数曲面) 配置
  for (let i = 0; i < pieData.length; i++) {
    sumValue += pieData[i].value
    let seriesItem = {
      //系统名称
      name:
        typeof pieData[i].name === 'undefined' ? `series${i}` : pieData[i].name,
      type: 'surface',
      //是否为参数曲面（是）
      parametric: true,
      //曲面图网格线（否）上面一根一根的
      wireframe: {
        show: false,
      },
      pieData: pieData[i],
      pieStatus: {
        selected: false,
        hovered: false,
        k: k,
      },
      //设置饼图在容器中的位置(目前没发现啥用)
      // center: ['80%', '100%'],
      radius: ['40%', '80%'],
    }

    //曲面的颜色、不透明度等样式。
    if (typeof pieData[i].itemStyle != 'undefined') {
      let itemStyle = {}
      typeof pieData[i].itemStyle.color != 'undefined'
        ? (itemStyle.color = pieData[i].itemStyle.color)
        : null
      typeof pieData[i].itemStyle.opacity != 'undefined'
        ? (itemStyle.opacity = pieData[i].itemStyle.opacity)
        : null
      seriesItem.itemStyle = itemStyle
      // seriesItem.radius = ['70%', '90%']
    }
    series.push(seriesItem)
  }

  // 使用上一次遍历时，计算出的数据和 sumValue，调用 getParametricEquation 函数，
  // 向每个 series-surface 传入不同的参数方程 series-surface.parametricEquation，也就是实现每一个扇形。
  legendData = []
  legendBfb = []
  for (let i = 0; i < series.length; i++) {
    endValue = startValue + series[i].pieData.value
    series[i].pieData.startRatio = startValue / sumValue
    series[i].pieData.endRatio = endValue / sumValue
    series[i].parametricEquation = getParametricEquation(
      series[i].pieData.startRatio,
      series[i].pieData.endRatio,
      false,
      false,
      k,
      series[i].pieData.value,
    )
    startValue = endValue
    let bfb = fomatFloat(series[i].pieData.value / sumValue, 4)
    legendData.push({
      name: series[i].name,
      value: bfb,
    })
    legendBfb.push({
      name: series[i].name,
      value: bfb,
    })
  }

  //(第二个参数可以设置你这个环形的高低程度)
  let boxHeight = getHeight3D(series, 10) //通过传参设定3d饼/环的高度
  // 准备待返回的配置项，把准备好的 legendData、series 传入。
  let option = {
    backgroundColor: 'transparent',
    //移动上去提示的文本内容(我没来得及改 你们可以根据需求改)
    tooltip: {
      formatter: (params) => {
        if (
          params.seriesName !== 'mouseoutSeries' &&
          params.seriesName !== 'pie2d'
        ) {
          let bfb = (
            (option.series[params.seriesIndex].pieData.endRatio -
              option.series[params.seriesIndex].pieData.startRatio) *
            100
          ).toFixed(2)
          return (
            `${params.seriesName}<br/>` +
            `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>` +
            `${bfb}`
          )
        }
      },
    },
    labelLine: {
      show: true,
      lineStyle: {
        color: '#7BC0CB',
      },
    },
    label: {
      show: true,
      position: 'outside',
      formatter: '{b} \n{c} {d}%',
    },
    //这个可以变形
    xAxis3D: {
      min: -1,
      max: 1,
    },
    yAxis3D: {
      min: -1,
      max: 1,
    },
    zAxis3D: {
      min: -1,
      max: 1,
    },
    //此处是修改样式的重点
    grid3D: {
      show: false,
      boxHeight: boxHeight, //圆环的高度
      //这是饼图的位置
      top: '0%',
      left: '0%',
      viewControl: {
        //3d效果可以放大、旋转等，请自己去查看官方配置
        alpha: 25, //角度(这个很重要 调节角度的)
        distance: 105, //调整视角到主体的距离，类似调整zoom(这是整体大小)
        rotateSensitivity: 0, //设置为0无法旋转
        zoomSensitivity: 0, //设置为0无法缩放
        panSensitivity: 0, //设置为0无法平移
        autoRotate: false, //自动旋转
      },
    },
    series: series,
  }
  return option
}
//获取3d丙图的最高扇区的高度
const getHeight3D = (series, height) => {
  series.sort((a, b) => {
    return b.pieData.value - a.pieData.value
  })
  return 1.5
}
// 生成扇形的曲面参数方程，用于 series-surface.parametricEquation
const getParametricEquation = (
  startRatio,
  endRatio,
  isSelected,
  isHovered,
  k,
  h,
) => {
  // 计算
  let midRatio = (startRatio + endRatio) / 2
  let startRadian = startRatio * Math.PI * 2
  let endRadian = endRatio * Math.PI * 2
  let midRadian = midRatio * Math.PI * 2
  // 如果只有一个扇形，则不实现选中效果。
  if (startRatio === 0 && endRatio === 1) {
    isSelected = false
  }
  // 通过扇形内径/外径的值，换算出辅助参数 k（默认值 1/3）
  k = typeof k !== 'undefined' ? k : 1 / 3
  // 计算选中效果分别在 x 轴、y 轴方向上的位移（未选中，则位移均为 0）
  let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0
  let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0
  // 计算高亮效果的放大比例（未高亮，则比例为 1）
  let hoverRate = isHovered ? 1.05 : 1
  // 返回曲面参数方程
  return {
    u: {
      min: -Math.PI,
      max: Math.PI * 3,
      step: Math.PI / 32,
    },
    v: {
      min: 0,
      max: Math.PI * 2,
      step: Math.PI / 20,
    },
    x: function (u, v) {
      if (u < startRadian) {
        return (
          offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate
        )
      }
      if (u > endRadian) {
        return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate
      }
      return offsetX + Math.cos(u) * (1 + Math.cos(v) * k) * hoverRate
    },
    y: function (u, v) {
      if (u < startRadian) {
        return (
          offsetY + Math.sin(startRadian) * (1 + Math.cos(v) * k) * hoverRate
        )
      }
      if (u > endRadian) {
        return offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate
      }
      return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate
    },
    z: function (u, v) {
      if (u < -Math.PI * 0.5) {
        return Math.sin(u)
      }
      if (u > Math.PI * 2.5) {
        return Math.sin(u) * h * 0.1
      }
      return Math.sin(v) > 0 ? 1 * h * 0.1 : -1
    },
  }
}
//这是一个自定义计算的方法
const fomatFloat = (num, n) => {
  var f = parseFloat(num)
  if (isNaN(f)) {
    return false
  }
  f = Math.round(num * Math.pow(10, n)) / Math.pow(10, n) // n 幂
  var s = f.toString()
  var rs = s.indexOf('.')
  //判定如果是整数，增加小数点再补0
  if (rs < 0) {
    rs = s.length
    s += '.'
  }
  while (s.length <= rs + n) {
    s += '0'
  }
  return s
}
event3DOptions.value = getPie3D(eventTaskOptions, 0.95)

const getWarnList = () => {
  getWarnIncident(paginationParams).then((res) => {
    eventTable.value = res.data.list
    totalNums.value = res.data.count
  })
}

onMounted(() => {
  getWarnList()
  getEventInfoListData()
  getWaringTypeData()
})
</script>
<template>
  <div :class="['right', isExpanded ? 'active' : '']">
    <card name="当前报警事件" class="alarm-event">
      <template #title>
        <i class="title-icon"></i>
      </template>
      <div class="top-input">
        <el-input
          v-model="paginationParams.content"
          placeholder="请输入事件名称"
          :prefix-icon="Search"
          @input="getWarnList"
        />
      </div>
      <div class="event-table">
        <el-table class="event-table-table" :data="eventTable" height="100%">
          <el-table-column prop="deviceName" label="设备名称" align="center" />
          <el-table-column prop="content" label="类型" align="center" />
          <el-table-column
            prop="createTime"
            label="时间"
            align="center"
            width="200"
          />
          <!-- <el-table-column prop="online" label="状态" align="center">
            <template #default="scope">
              <span v-if="scope.row.online == 1" style="color: #50fea3"
                >在线</span
              >
              <span v-else style="color: #ff6059">离线</span>
            </template>
          </el-table-column> -->
        </el-table>
        <div class="pagination">
          <el-pagination
            class="custom-pagination"
            :current-page="paginationParams.pageIndex"
            :page-size="paginationParams.pageSize"
            background
            :page-sizes="[10, 20, 30, 50]"
            layout="prev, pager, next"
            :total="totalNums"
            @current-change="handleChange"
          />
        </div>
      </div>
    </card>
    <card name="报警事件统计" class="alarm-statistics">
      <template #title>
        <i class="title-icon"></i>
      </template>
      <div class="events">
        <div
          class="event"
          v-for="(item, index) in eventNumList"
          :key="index"
          :style="{ backgroundImage: `url(${item.img})` }"
        >
          <div class="event-info">
            <div class="event-info-name">{{ item.name }}</div>
            <div class="event-info-value">
              <span>{{ item.value }}</span
              >起
            </div>
          </div>
        </div>
      </div>
      <!--      <div class="area-title">-->
      <!--        <div class="area-title-left" style="justify-content: flex-start">-->
      <!--          <div class="area-title-left-names">-->
      <!--            <div class="area-title-left-name">报警状态统计</div>-->
      <!--          </div>-->
      <!--        </div>-->
      <!--      </div>-->
      <!--      <div class="inspection">-->
      <!--        <div class="inspection-left">-->
      <!--          <div class="inspection-left-top">-->
      <!--            <div class="total-num">-->
      <!--              <div class="value"><span>240</span>个</div>-->
      <!--              <div class="name">任务总数</div>-->
      <!--            </div>-->
      <!--            <draw-echarts-->
      <!--              width="200"-->
      <!--              height="130"-->
      <!--              v-if="event3DOptions"-->
      <!--              :options="event3DOptions"-->
      <!--            ></draw-echarts>-->
      <!--          </div>-->
      <!--          <div class="inspection-left-bottom"></div>-->
      <!--        </div>-->
      <!--        <div class="inspection-right">-->
      <!--          <div-->
      <!--            class="inspection-right-line"-->
      <!--            v-for="(item, index) in eventTaskOptions"-->
      <!--            :key="index"-->
      <!--            :style="{ color: item.itemStyle.color }"-->
      <!--          >-->
      <!--            <div-->
      <!--              class="left-icon"-->
      <!--              :style="{ backgroundColor: item.itemStyle.color }"-->
      <!--            ></div>-->
      <!--            <div class="name">{{ item.name }}</div>-->
      <!--            <div class="value">{{ item.value }}个</div>-->
      <!--            <div class="percent">{{ item.percent }}%</div>-->
      <!--          </div>-->
      <!--        </div>-->
      <!--      </div>-->
      <div class="area-title" style="margin-top: 30px">
        <div class="area-title-left" style="justify-content: flex-start">
          <div class="area-title-left-names">
            <div class="area-title-left-name">报警分类统计</div>
          </div>
        </div>
      </div>
      <div class="alarm-chart">
        <draw-echarts
          ref="classificationChartRef"
          width="420"
          height="250"
          :options="classificationOptions"
        ></draw-echarts>
      </div>
    </card>
  </div>
</template>
<style scoped lang="scss">
.right {
  .title-icon {
    display: inline-flex;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    height: 61px;
    position: relative;
    bottom: 20px;
    // margin-top: 10px;
  }

  .area-title {
    display: flex;
    height: 21px;
    position: relative;

    &-left {
      height: 100%;
      width: 50%;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      background-image: url('@/assets/imgs/tab_yq_d.png');
      margin-left: 10px;
      display: flex;
      justify-content: flex-start;
      padding-left: 20px;

      &-names {
        width: 100px;
        display: flex;
        justify-content: flex-start;
      }

      &-name {
        font-family: Source Han Sans SC;
        font-weight: bold;
        font-size: 16px;
        color: #00a6ff;
        background: linear-gradient(0deg, #8dc4ff 0%, #ffffff 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        cursor: pointer;
      }

      .is-active {
        font-weight: bold;
        font-size: 16px;
        color: #ffffff;
        background: linear-gradient(259deg, #fff4c8 0%, #ffc152 98.9990234375%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }
    }
  }

  .alarm-event {
    height: 396px;
    margin-bottom: 20px;
    position: relative;

    .title-icon {
      width: 152px;
      background-image: url('@/assets/imgs/dqbjsj_title.png');
    }

    .top-input {
      margin-bottom: 5px;
      padding: 5px;

      :deep(.el-input) {
        .el-input__wrapper {
          background-color: rgba(11, 36, 70, 0.65);
          border-radius: 18px;
          box-shadow: none;
          border: 1px solid #2889ff;

          .el-input__prefix {
            color: #c4eaff;
          }

          .el-input__inner {
            font-family: Source Han Sans SC;
            font-weight: 500;
            font-size: 12px;
            color: #c4eaff;
          }

          .el-input__inner::placeholder {
            color: #c4eaff;
          }
        }
      }
    }

    .event-table {
      height: calc(100% - 40px);

      :deep(.el-table) {
        background-color: transparent;
        color: #fff;

        tr {
          background-color: transparent;
        }

        th.el-table__cell {
          background-color: transparent;
          font-family: Source Han Sans SC;
          font-weight: 500;
          font-size: 14px;
          color: #c4eaff;
        }

        tbody tr:hover > td {
          background-color: transparent !important;
        }

        .el-table__cell {
          border-bottom: none;
        }

        .el-table__inner-wrapper::before {
          height: 0px;
        }

        .el-table__header-wrapper {
          background-size: 100% 100%;
          background-repeat: no-repeat;
          background-image: url('@/assets/imgs/list_top_sblb.png');
        }

        .el-table__body-wrapper {
          background-size: 100% 100%;
          background-repeat: no-repeat;
          background-image: url('@/assets/imgs/list_bottom_event.png');
          padding-bottom: 10px;

          .el-table__cell {
            border-bottom: 1px solid rgba($color: #657ca8, $alpha: 0.6);
          }
        }
      }
    }
    .pagination {
      top: 0;
      right: 0;
      position: absolute;
      margin: 345px 10px 0 0;

      :deep(.el-pagination) {
        button {
          background-color: rgba(0, 0, 0, 0);
        }

        .el-pager {
          li {
            color: white !important;
            background-color: rgb(19, 63, 123);
          }
        }

        .el-select__wrapper {
          background-color: rgba(0, 0, 0, 0) !important;

          .el-select__selected-item {
            color: white !important;
          }
        }
      }
    }
  }

  .alarm-statistics {
    height: 638px;

    .title-icon {
      width: 152px;
      background-image: url('@/assets/imgs/bjsjtj_title.png');
    }
    .events {
      display: flex;
      height: 110px;
      align-items: center;
      justify-content: space-around;
      margin-bottom: 6px;
      .event {
        width: 124px;
        height: 54px;
        background-repeat: no-repeat;
        background-size: 100% 100%;
        display: flex;
        justify-content: flex-end;
        &-info {
          width: 80%;
          height: 100%;
          font-weight: 400;
          font-size: 14px;
          color: #ffffff;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          &-name {
            line-height: 20px;
            height: 20px;
          }
          &-value {
            line-height: 30px;
            height: 30px;
            span {
              font-family: Source Han Sans SC;
              font-weight: bold;
              font-size: 20px;
              color: #36d5f0;
              margin-right: 4px;
            }
          }
        }
      }
    }

    .inspection {
      height: 140px;
      display: flex;
      margin-bottom: 10px;

      &-left {
        width: 50%;
        height: 100%;

        &-top {
          width: 100%;
          height: 100%;
          z-index: 10;
          // background-color: transparent;
          position: relative;

          .total-num {
            color: #ffffff;
            position: absolute;
            width: 80%;
            left: 10%;
            text-align: center;
            top: 33.5%;
            z-index: 100;

            .value {
              color: #b2c9df;

              span {
                color: #ffffff;
                font-size: 26px;
              }
            }

            .name {
            }
          }

          :deep(.echarts-container) {
            z-index: 10;
            // background-color: transparent;
          }
        }

        &-bottom {
          width: 100%;
          height: 100%;
          background-size: 100% 100%;
          background-repeat: no-repeat;
          background-image: url('@/assets/imgs/img_bt_d.png');
          position: relative;
          bottom: 80%;
          right: 5px;
          z-index: 0;
        }
      }

      &-right {
        width: 50%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;

        // align-items: center;
        &-line {
          display: flex;
          height: 30px;
          align-items: center;
          font-weight: 500;
          font-size: 12px;

          .left-icon {
            width: 8px;
            height: 8px;
          }

          .name {
            color: #c4eaff;
            margin-left: 20px;
            width: 60px;
          }

          .value {
            width: 40px;
            margin-left: 20px;
          }

          .percent {
            margin-left: 10px;
          }
        }
      }
    }
    .alarm-chart {
    }
  }
}
</style>
